<?php
// 命名空间定义
namespace app\index\controller;
 
use app\common\controller\IndexController;
use think\App;


class Index extends IndexController
{
    /**
     * 初始化方法
     */
    protected function initialize()
    {
        parent::initialize();
    }
    public function index(){
        return $this->fetch();
    }
    public function callback(){
        // return; 
        $param = $this->request->param();
        // if(count(explode('_',$param['state'])) > 1){
        //     header("Location: http://192.168.2.31:8080/h5/?code={$param['code']}&state={$param['state']}#/pages/Totalofproducts/Totalofproducts");
        // }else{
        //     header("Location: http://192.168.2.31:8080/h5/?code={$param['code']}&state={$param['state']}#/pages/login/login");
        // }
        if(count(explode('_',$param['state'])) > 1){
            header("Location: https://hosj4bb2pabe-5768.beijing-02.dayunet.com/?code={$param['code']}&state={$param['state']}#/pages/Totalofproducts/Totalofproducts");
        }else{
            header("Location: https://hosj4bb2pabe-5768.beijing-02.dayunet.com/?code={$param['code']}&state={$param['state']}#/pages/login/login");
        }
    }
}